from sqlalchemy import Column, String, Integer
from sqlalchemy.dialects.postgresql import JSONB
from sqlalchemy.ext.declarative import declarative_base


Base = declarative_base()


class ConfigManage(Base):
    """全局配置管理"""
    __tablename__ = 'config_manage'
    name = Column(String, primary_key=True, nullable=False, comment='配置名')
    description = Column(String, default='', comment='配置描述')
    config = Column(JSONB, default=[], comment='采集配置')
    tag = Column(JSONB, default=[], comment='配置标签')
    builtin = Column(Integer, default=1, comment='内置配置')
